/*===========================================================================+
 |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
 |                         All rights reserved.                              |
 +===========================================================================+
 |  HISTORY                                                                  |
 +===========================================================================*/
package xxhci.oracle.apps.xxierp.SalaryAdvance.webui;

import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;

/**
 * Controller for ...
 */
public class MyCO extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
    
    
    
//    
//                 try {
//                 
//    OAMessageTextInputBean a = (OAMessageTextInputBean)webBean.findChildRecursive("AdvanceAmount");
//        OAMessageTextInputBean d = (OAMessageTextInputBean)webBean.findChildRecursive("NoOfInstalments");
//        OAMessageTextInputBean b = (OAMessageTextInputBean)webBean.findChildRecursive("BasicSalary");
//    OAMessageTextInputBean c = (OAMessageTextInputBean)webBean.findChildRecursive("InstalmentAmount");
//    
                 
//                   String jScript="javascript:calcInstallment(this.form); " + 
//                             " function calcInstallment(f){alert(document.getElementById("+a+").value);alert(document.getElementById("+b+").value);}" ;
//            
                 
//               String jScript = "javascript:calcInstallment(this.form); " +
//             " function calcInstallment(f){" +
//             "document.getElementById('BasicSalary').readOnly='false';}";
//               
//                   "if( document.getElementById('AdvanceAmount').value > document.getElementById('BasicSalary').value) " +
//                       "{ " +
//                       "alert('Salary Advance Amount Should be less than Basic Salary'); " +
//                       "document.getElementById('AdvanceAmount').value='';" +
//                       "document.getElementById('AdvanceAmount').focus();" +
//                       "} " +
//                   "else " +
//                       "document.getElementById('InstalmentAmount').value= document.getElementById('AdvanceAmount').value / document.getElementById('NoOfInstalments').value;" +
//               "}";
//               OAMessageTextInputBean txtAdvAmt = (OAMessageTextInputBean)webBean.findChildRecursive("AdvanceAmount");
//                   OAMessageTextInputBean txtInst = (OAMessageTextInputBean)webBean.findChildRecursive("NoOfInstalments");
//                   OAMessageTextInputBean txtBasic = (OAMessageTextInputBean)webBean.findChildRecursive("BasicSalary");
//              if(txtAdvAmt != null)
//               txtAdvAmt.setOnChange(jScript);
//           
//                 
//                  // if(txtInst != null)
//                  // txtInst.setOnChange(jScript);
//               }catch(Exception e) {
//               throw new OAException(e.getMessage());
//               }
//               
}
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
  }

}
